#pragma once

#include "CLogField.h"
#include <memory>
#include <map>
#include <functional>


class CLogRecord 
{
public:
	void AddField(const std::string& fieldName, const CLogValue& value);
	 void AddField(const CLogFieldPtr& field);
	 std::map<std::string, CLogFieldPtr>& GetFields();
	 CLogFieldPtr getField(const std::string& fieldName);
	 bool hasField(const std::string& fieldName) const;
	 int enumFields(std::function<int (CLogFieldPtr& field)> func);

	 uint64_t getRecordSize() const;
private:
	std::map<std::string, CLogFieldPtr> m_fields;
};

typedef std::shared_ptr<CLogRecord> CLogRecordPtr;
